def nine_for():
   for n in range(1, 10):
      print()
      for m in range(1, n+1):
         print('{}x{}={}\t'.format(n, m, n * m), end='')
   print('\n'+'='*80)
   for n in range(9,0,-1):
      print()
      for m in range(1, n+1):
         print('{}x{}={}\t'.format(n, m, n*m), end='')
   print('\n'+'='*80)
   for n in range(1, 10):
      print()
      for a in range(1, 10-n):
         print("{}{}{}{}{}\t".format(' ',' ',' ',' ',' '), end='')
      for m in range(10-n, 10):
         print("{}*{}={}\t".format(10-m, n,(10-m)*n), end='')
   print('\n' + '=' * 80)
   for n in range(9, 0,-1):
      print()
      for a in range(1, 10-n):
         print("{}{}{}{}{}\t".format(' ', ' ', ' ', ' ', ' '), end='')
      for m in range(10 - n, 10):
         print("{}*{}={}\t".format(10 - m, n, (10 - m) * n), end='')

nine_for()







